/* 
 *  Copyright 2012 CodeMagi, Inc.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.codemagi.login.model;

import java.io.Serializable;

/**
 * A permissions group in the role-based permissions system 
 * within the CodeMagi web application framework.
 *
 *  @version 1.0
 *  @author August Detlefsen for CodeMagi, Inc.
 */
public class Group extends com.codemagi.servlets.model.BaseBean implements Serializable {

    //MEMBERS -----------------------------------------------------------------

    //    private Integer id;
    private String groupName;
    private String displayName;
    private String description;
    private Integer sortOrder;
    private Boolean isOnline;


    //GETTERS AND SETTERS -----------------------------------------------------

    /*
    public void setId(Integer newValue) {
        id = newValue;
    }

    public Integer getId() {
        return id;
    }
    */

    public void setGroupName(String newValue) {
        groupName = newValue;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setDisplayName(String newValue) {
        displayName = newValue;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDescription(String newValue) {
        description = newValue;
    }

    public String getDescription() {
        return description;
    }

    public void setSortOrder(Integer newValue) {
        sortOrder = newValue;
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setIsOnline(Boolean newValue) {
        isOnline = newValue;
    }

    public Boolean getIsOnline() {
        return isOnline;
    }


    /**
     * Overridden equals() returns true if two Groups have the same groupName.
     */
    public boolean equals(Object o) {
        try {
            Group test = (Group)o;
	    return this.getGroupName().equals(test.getGroupName());

        } catch (Exception e) {
            return false;
        }
    }


    /**
     * Overridden toString() method to return more useful information
     */
    public String toString() {

	return getClass().getName() + ": ID: " + getId() + " NAME: " + getGroupName() ;

    }


}







